
JavaArt Chapter 2. Executing Pixels using Drag-and-Drop

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This chapter follows on from 
   "JavaArt Chapter 1: On-the-Fly Dynamic Compilation and Execution"
   http://fivedots.coe.psu.ac.th/~ad/jg/javaArt1/


============================

This directory contains:

  * two java files
      - ExecutePixels.java, 
        ImageText.java (a copy of the one in TranslatePixels/)

  * a batch file: toJar.bat
       - it compiles ExecutePixels.java, and generates a JAR file

  * a JAR file manifest: manifest.txt
       - used by toJar.bat to create the JAR file

  * a splash screen image: epSplash.png
       - added to the JAR file created by toJar.bat

  * the Janino compiler API: janino.jar
       - called by ExecutePixels.java

  * three test PNG files
       - Comparison.png, Painter.png   (these will run)
       - notExecutable.png   (this is not a translated Java file, so will not run)


----------------------------
The Janino API

Janino is available from http://www.janino.net/ 

I downloaded version 2.5.15 as a zipped file containing the janino.jar 
library, source code, examples, and API documentation. 

The unzipped janino JAR, janino.jar, should be placed in this directory,
so it is in the same place as ExecutePixels.java


----------------------------

Compilation and JAR file creation:

> toJar
    // this will create ExecutePixels.class and ExecutePixels.jar;
    // the JAR file uses manifest.txt and epSplash.png


----------------------------

Execution (using ExecutePixels.class): 

> java -cp "janino.jar;." ExecutePixels Comparison.png

> java -cp "janino.jar;." ExecutePixels Painter.png

> java -cp "janino.jar;." ExecutePixels notExecutable.png     
        // this image is not derived from Java code, so will not execute


----------------------------

Execution (using ExecutePixels.jar): 

> java -jar ExecutePixels.jar Comparison.png    // janino.jar must be in this directory

> java -jar ExecutePixels.jar Painter.png

> java -jar ExecutePixels.jar notExecutable.png

---------
Last updated: 13th February 2009
